// 搜索栏
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';

class DownModal extends StatefulWidget {
  final void Function() cameraCb;
  final void Function() photoCb;
  const DownModal({Key key, this.cameraCb, this.photoCb}) : super(key: key);

  @override
  _DownModalState createState() => _DownModalState();
}

class _DownModalState extends State<DownModal> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 194.5,
      color: Color.fromRGBO(0, 0, 0, 0.55),
      child: Container(
        height: 194.5,
        decoration: BoxDecoration(
          color: Color.fromRGBO(243, 243, 243, 1),
          borderRadius: BorderRadius.only(
            topLeft: Radius.circular(8),
            topRight: Radius.circular(8),
          ),
        ),
        child: Column(
          children: <Widget>[
            GestureDetector(
              onTap: () {
                Navigator.of(context).pop();
                widget.cameraCb();
              },
              child: Container(
                width: double.infinity,
                height: 62,
                alignment: Alignment.center,
                decoration: BoxDecoration(
                  color: Color.fromRGBO(255, 255, 255, 1),
                  borderRadius: BorderRadius.only(
                    topLeft: Radius.circular(8),
                    topRight: Radius.circular(8),
                  ),
                ),
                child: Text(
                  '拍摄',
                  style: TextStyle(
                    fontSize: 16,
                    height: 22 / 16,
                    color: Color.fromRGBO(43, 44, 46, 1),
                  ),
                ),
              ),
            ),
            GestureDetector(
              onTap: () {
                Navigator.of(context).pop();
                widget.photoCb();
              },
              child: Container(
                width: double.infinity,
                height: 62,
                alignment: Alignment.center,
                decoration: BoxDecoration(
                  color: Color.fromRGBO(255, 255, 255, 1),
                  border: Border(
                    top: BorderSide(
                      width: 0.5,
                      color: Color.fromRGBO(229, 229, 229, 1),
                    ),
                  ),
                ),
                child: Text(
                  '从手机相册选择',
                  style: TextStyle(
                    fontSize: 16,
                    height: 22 / 16,
                    color: Color.fromRGBO(43, 44, 46, 1),
                  ),
                ),
              ),
            ),
            GestureDetector(
              onTap: () {
                Navigator.of(context).pop();
              },
              child: Container(
                width: double.infinity,
                height: 62,
                alignment: Alignment.center,
                margin: EdgeInsets.only(top: 8),
                color: Color.fromRGBO(255, 255, 255, 1),
                child: Text(
                  '取消',
                  style: TextStyle(
                    fontSize: 16,
                    height: 22 / 16,
                    color: Color.fromRGBO(43, 44, 46, 1),
                  ),
                ),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
